<?php
/**
 * @ClassName: CustomerEnum
 * @Description: TODO
 * @author: gydtrade
 * @Date: 2025-09-28 17:21
 * @Version: V1.0.0
 */

namespace app\common\enum;

class CustomerEnum
{
    const customer_type_family = 1;
    const customer_type_enterprise = 2;
    const customer_type_street = 3;

    /**
     * 客户类型
     * @param $level
     * @return string|string[]
     */
    public static function customerTypeText($level)
    {
        $desc = [
            CustomerEnum::customer_type_family => '家庭客户',
            CustomerEnum::customer_type_enterprise => '企业单位',
            CustomerEnum::customer_type_street => '街边店铺',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 服务类型
     * @param $level
     * @return string|string[]
     */
    public static function serviceTypes($level)
    {
        $desc = [
            0 => '无',
            1 => '水架',
            2 => '定期送',
            3 => '饮水设备',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 常规类型
     * @param $level
     * @return string|string[]
     */
    public static function regularTypes($level)
    {
        $desc = [
            1 => '每周',
            2 => '每月',
            3 => '间隔',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 用水人数
     * @param $level
     * @return string|string[]
     */
    public static function waterUsers($level)
    {
        $desc = [
            1 => '1-5人',
            2 => '5-10人',
            3 => '10-20人',
            4 => '20-30人',
            5 => '30-50人',
            6 => '>50人',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 有无电梯
     * @param $level
     * @return string|string[]
     */
    public static function elevatorTypes($level)
    {
        $desc = [
            0 => '无',
            1 => '有',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 月结状态
     * @param $level
     * @return string|string[]
     */
    public static function monthSettleStatus($level)
    {
        $desc = [
            0 => '未开启',
            1 => '开启',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 客户推广类型
     * @param $level
     * @return string|string[]
     */
    public static function spreadTypes($level)
    {
        $desc = [
            -1 => '无',
            1 => '商家',
            2 => '门店',
            3 => '代理',
            4 => '师傅',
            5 => '员工',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

}